package com.whsr.readservice.service;


import com.whsr.readservice.dao.AttachMentMapper;
import com.whsr.readservice.vo.AttachMent;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("fileUploadService")
@Transactional
public class FileUploadService {

    private final AttachMentMapper attachMentMapper;

    public FileUploadService(AttachMentMapper attachMentMapper) {
        this.attachMentMapper = attachMentMapper;
    }


    public void imgUpload(AttachMent attachMent) {

        this.attachMentMapper.saveImage(attachMent);

    }

    public AttachMent getImgById(int id) {
        return  this.attachMentMapper.getImgById(id);
    }
}
